<?php


namespace app\partneradmin\validate;


use think\Validate;

class CustomerServicePersonnel extends Validate
{
    //字段规则
    protected $rule = [
        'name' => 'require|unique:customer_service_personnel',
        'phone' => 'require',
        'customer_service_group_id' => 'require',
    ];

    //验证器提示信息
    protected $message = [
        'password.require' => '密码不能为空',
        'name.require' => '人员名字不能为空',
        'name.unique' => '人员名字不能重复',
        'phone.require' => '人员联系方式不能为空',
        'customer_service_group_id.require' => '客服组id不能为空',
    ];

    //使用场景
    protected $scene = [
        'add' => ['name', 'customer_service_group_id'],
        'edit' => ['name' => 'require', 'customer_service_group_id']
    ];
}